Skip to content

fix(chat): don't cancel an active send when New Chat resolves into its session#706

Open
bdtsimon wants to merge 1 commit into
outsourc-e:mainfrom
bdtsimon:fix/false-operation-interrupted
Open

fix(chat): don't cancel an active send when New Chat resolves into its session#706
bdtsimon wants to merge 1 commit into
outsourc-e:mainfrom
bdtsimon:fix/false-operation-interrupted

Conversation

@bdtsimon

@bdtsimon bdtsimon commented Jul 8, 2026

Copy link
Copy Markdown

Problem

When a New Chat resolves from its temporary state into the real session key, the navigation-change effect in ChatScreen treats that internal resolution as a genuine navigation and calls cancelStreaming(). The gateway keeps producing a valid stream, but the UI surfaces a false "Operation interrupted" (it reproduced far less in incognito, which pointed at UI/session state rather than the gateway).

Fix

Guard the cancel: when an active send is resolving into the now-active session (matched by sessionKey / friendlyId), it is not cancelled. Genuine navigations still cancel exactly as before. One focused change in chat-screen.tsx.

Found and fixed while running a self-hosted deployment; tool-heavy prompts now complete without the spurious interruption.

Reviewed by bdtsimon

…s session

When a New Chat resolves from its temporary state into the real session key, the
navigation-change effect treated that internal resolution as a genuine navigation
and called cancelStreaming(), surfacing a false "Operation interrupted" even
though the gateway was still producing a valid stream. Guard the cancel so an
active send that is resolving into the now-active session (matched by
sessionKey / friendlyId) is not cancelled.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant